CC:=gcc
ROOT:=/home/Learn
SRC:=$(ROOT)/src
LIB:=$(ROOT)/lib
INCLUDE:=$(ROOT)/include
BIN:=$(ROOT)/bin

libfun.so: fun.o
	$(CC) -shared -fPIC -o /lib/libfun.so $(BIN)/fun.o
fun.o: src/fun.c
	$(CC) -c src/fun.c -o $(BIN)/fun.o
test: src/test.c include/head.h
	$(CC) -o bin/test src/test.c -Llib/ -Iinclude/ -lfun
all:libfun.so test
	cp -r /lib/libfun.so $(LIB)
	echo "haha"
	g++ -o bin/cpp src/c.cpp
default:
	g++ -o bin/cpp src/c.cpp
#	echo "hehe"
clean:
	sudo rm -rf bin/*.o lib/libfun.so bin/test /lib/libfun.so
